//import com.zhijiang.common.util.ResponseResult;
//import com.zhijiang.hospital.entrty.User;
//import com.zhijiang.hospital.mapper.EmpolyeeMapper;
//import com.zhijiang.hospital.mapper.UserMapper;
//import com.zhijiang.hospital.service.UserService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//
//import javax.annotation.Resource;
//
//@Service
//public class UserServiceImpl implements UserService {
//
//    @Resource
//    private UserMapper userMapper;
//
//
//
////    @Override
////    public ResponseResult login(User user) {
////        UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(user.getUserName(),user.getPassword());
////        Authentication authenticate = authenticationManager.authenticate(authenticationToken);
////        LoginUser loginUser = (LoginUser)authenticate.getPrincipal();
////        String userId = loginUser.getUser().getId();
////        String jwt = JwtUtil.createJWT(userId);
////        redisCache.setCacheObject( RedisConstants.LOGIN+userId,loginUser,RedisConstants.LOGIN_CODE_TTL, RedisConstants.LOGINUNIT);
////        HashMap<String, String> map = new HashMap<>();
////        map.put("token",jwt);
////        return new ResponseResult(200,map);
////    }
////
////    @PostMapping("login")
////    @PassToken
////    public R login(@RequestBody EmployeeDto comEmployee){
////        EmployeeDto login = employeeService.login(comEmployee);
////        return R.ok(login);
////    }
//
//    @Autowired
//    EmpolyeeMapper empolyeeMapper;
//
//    @Override
//    public ResponseResult login(User user) {
//        return null;
//    }
//
//    @Override
//    public ResponseResult register(User sysUser) {
//        return null;
//    }
////    @Override
////    public ResponseResult register(User sysUser) {
////          ComEmployee comEmployee = empolyeeMapper.selectOne(sysUser.getUserName());
////        if (Objects.isNull(comEmployee)||comEmployee.equals("2")){
////            throw new RuntimeException("不是本院员工无法注册");
////        }
////
////
////        User one = userMapper.findOne(sysUser.getUserName());
////        if (Objects.isNull(one)){
////            throw new RuntimeException("账号错误");
////        }
////        sysUser.setPassword(passwordEncoder.encode(sysUser.getPassword()));
////        sysUser.setUserType("1");
////        sysUser.setStatus("0");
////        sysUser.setDelFlag(1);
////        userMapper.insert(sysUser);
////        return new ResponseResult(200,"添加成功");
////    }
//
//
//}
